package java14;

public class Student {
    private final String name;

    public Student(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof Student student) {
            return student.name.equals(this.name);
        }
        return false;
    }
}
